﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using MySqlSugar;
using Zhj.Community.Domain.Entitys;
using Zhj.Community.Domain.IRepository;

namespace Zhj.Community.Repository.Test
{
    public class TestStudentRepository : BaseRepository<TestStudent, long>, ITestStudentRepository
    {
        public string TestFunc()
        {
            return "test";
        }

        private readonly List<TestStudent> _list = new List<TestStudent>()
        {
            new TestStudent()
            {
                Id = 1,
                Age = 18,
                Name = "zhaohanjia1",
                School = "抚宁二中"
            },
            new TestStudent()
            {
                Id = 2,
                Age = 18,
                Name = "zhaohanjia2",
                School = "抚宁二中"
            },
            new TestStudent()
            {
                Id = 3,
                Age = 18,
                Name = "zhaohanjia3",
                School = "抚宁二中"
            },
            new TestStudent()
            {
                Id = 4,
                Age = 18,
                Name = "zhaohanjia4",
                School = "抚宁二中"
            }
        };

        public override List<TestStudent> GetAll()
        {
            return _list;
        }

        public override TestStudent Get(long id)
        {
            return _list.FirstOrDefault(l => l.Id == id);
        }

    }
}
